CREATE TABLE [dbo].[TMORDE_SERV]
(
[CO_ORDE_SERV] [dbo].[TD_VC_020] NOT NULL,
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[DE_ORDE_SERV] [dbo].[TD_VC_050] NOT NULL,
[ST_OTRS] [dbo].[TD_VC_020] NULL,
[TI_SITU] [dbo].[TD_VC_003] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMORDE_SE__CO_US__1AD3FDA4] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMORDE_SE__FE_US__1BC821DD] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMORDE_SE__CO_US__1CBC4616] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMORDE_SE__FE_US__1DB06A4F] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMORDE_SERV] ADD CONSTRAINT [PK__TMORDE_S__F9A97A161446FBA6] PRIMARY KEY CLUSTERED  ([CO_ORDE_SERV], [CO_EMPR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMORDE_SERV] ADD CONSTRAINT [FK__TMORDE_SE__CO_EM__40E497F3] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMEMPR] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TMORDE_SERV] ADD CONSTRAINT [FK__TMORDE_SE__TI_SI__3FF073BA] FOREIGN KEY ([TI_SITU]) REFERENCES [dbo].[TTSITU] ([TI_SITU])
GO
GRANT SELECT ON  [dbo].[TMORDE_SERV] TO [public]
GRANT INSERT ON  [dbo].[TMORDE_SERV] TO [public]
GRANT DELETE ON  [dbo].[TMORDE_SERV] TO [public]
GRANT UPDATE ON  [dbo].[TMORDE_SERV] TO [public]
GO
